package com.tim.app.server.entry;

import android.text.TextUtils;

import com.tim.app.constant.AppKey;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 回答
 */
public class Answer extends BaseObject implements Serializable {

    private String problemId;
    private String content;
    private String problemTitle;
    private String problemContent;
    private int topicId;
    private String topicTitle;
    private String userId;
    private String digest;
    private int isAnonymous;

    public String getProblemId() {
        return problemId;
    }

    public void setProblemId(String problemId) {
        this.problemId = problemId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getProblemTitle() {
        return problemTitle;
    }

    public void setProblemTitle(String problemTitle) {
        this.problemTitle = problemTitle;
    }

    public String getProblemContent() {
        return problemContent;
    }

    public void setProblemContent(String problemContent) {
        this.problemContent = problemContent;
    }

    public int getTopicId() {
        return topicId;
    }

    public void setTopicId(int topicId) {
        this.topicId = topicId;
    }

    public String getTopicTitle() {
        return topicTitle;
    }

    public void setTopicTitle(String topicTitle) {
        this.topicTitle = topicTitle;
    }

    public String getDigest() {
        return digest;
    }

    public void setDigest(String digest) {
        this.digest = digest;
    }

    public int getIsAnonymous() {
        return isAnonymous;
    }

    public void setIsAnonymous(int isAnonymous) {
        this.isAnonymous = isAnonymous;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public List<String> getImageUrl() {
        if(!TextUtils.isEmpty(getImage())){
            if(getImage().contains(AppKey.SEPARATOR)){
                return Arrays.asList(getImage().split(AppKey.SEPARATOR));
            }else{
                List<String> list = new ArrayList<>();
                list.add(getImage());
                return list;
            }
        }
        return null;
    }
}
